<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>补订</title>
    <link rel="stylesheet" href="__TMPL__Public/assets/css/Reset.css">
    <link rel="stylesheet" href="__TMPL__Public/assets/css/style.css">
</head>
<body>
    <!-- 订购内容 -->
    <div class="sc-order">
            <div class="info-title">
                <h2>logo</h2>
                <p>校服订购</p>
            </div>
            <div class="or-con">
                <div class="or-title">校服订购</div>
                    <input type="text" name="study_code" id="study_code" placeholder="请输入您学校提供的6位编码" class="or1">
                    <select name="shop_sex" id="shop_sex" class="or2">
                        <option value="0">请选择孩子的性别</option>
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>
                <input type="hidden" name="study_id" id="study_id" value="">
                    <button class="or-btn">进入</button>
            </div>
    </div>
    <!-- 底部导航 -->
    <div class="bott-footer"></div>
    <tc_include file="Public:footer"/>
    <script src="__TMPL__Public/assets/js/jquery-v1.10.2.min.js"></script>
    <script src="__TMPL__Public/assets/layer/layer.js"></script>
    <script>
        $(function () {
           $('.or-btn').click(function () {
               var code = $('#study_code').val();
               var sex = $('#shop_sex').val();
              if(code == ''){
                  layer.alert('请输入您学校提供的6位编码',{title:false,closeBtn: 0,btn:false,time:1500});
                  $('#study_code').focus();
                  return false;
              }
              if(sex == '0'){
                  layer.alert('请选择性别分类',{title:false,closeBtn: 0,btn:false,time:1500});
                  $('#shop_sex').focus();
                  return false;
              }
              $.post("{:U('Shop/post')}",{study_code:code},function(e){
                  if(e != '-1'){
                      $('#study_id').val(e);
                  }
                  if(e == '-1'){
                      layer.alert('您输入的学校编码不存在',{title:false,closeBtn: 0,btn:false,time:1500});
                  }else{
                      sex = $('#shop_sex').val();
                      var study_id = $('#study_id').val();
                      window.location = "__ROOT__/index.php/Portal/Study/study/study_id/"+study_id+"/shop_sex/"+sex;
                  }
              });
           });
        });
    </script>
</body>
</html>